Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 8 - TCP/IP Services / TCP/IP Services Reference
Functions / Opening a TCP/IP Service Provider


OTOpenInternetServices

Opens the TCP/IP service provider and returns an internet services reference. This function runs synchronously.

C INTERFACE
InetSvcRef OTOpenInternetServices (OTConfiguration *cfig,
                                   OTOpenFlags oflag,
                                   OSStatus *err);
C++ INTERFACE
None. C++ clients use the C interface to this function.

PARAMETERS
cfig
A pointer to a network configuration structure. Specify nil for this parameter to have the function provide the network configuration structure for you. You can also obtain this pointer by using the constant kDefaultInternetServicesPath for this parameter.
oflag
Reserved. Must be set to 0.
err
The function result.
DESCRIPTION
You must open the TCP/IP service provider before calling any TCP/IP service function other than the address utility functions. The return value of this function is the internet services reference. You must provide the internet services reference when calling any of these non-utility functions. The OTOpenInternetServices function also sets the mode of all other TCP/IP service functions as synchronous.

If you want to set an option as part of the configuration string, you should translate the option's constant name, given in the header files, into a string that the configuration functions can parse. For the TCP/IP options, Table 8-2 on page 8-37 provides the constant name used in "Options," beginning on page 8-28 and the value to used in the configuration string

SEE ALSO
The OTAsyncOpenInternetServices function (page 8-36) is an asynchronous version of the TCP/IP open services function.

The network configuration structure and OTCreateConfiguration function are described in the chapter "Configuration Management" in this book.

Use the OTCloseProvider function, described in the chapter "Endpoints" in this book, to close a TCP/IP service provider when you are finished using it.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996